/**
* Copyright (C) 2018-2020
* All rights reserved, Designed By www.gzchengguo.cn
* 注意：
* 本软件为www.gzchengguo.cn开发研制，未经购买不得商用
* 购买后可获得全部源代码（禁止转卖、分享、上传到码云、github等开源平台）
* 一经发现盗用、分享等行为，将追究法律责任，后果自负
*/
package link.chengguo.orangemall.modules.activity.rest;

import link.chengguo.orangemall.logging.aop.log.Log;
import link.chengguo.orangemall.modules.activity.service.OrangeStoreCouponUserService;
import link.chengguo.orangemall.modules.activity.service.dto.OrangeStoreCouponUserQueryCriteria;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
* @author chengguo
* @date 2019-11-10
*/
@Api(tags = "商城:优惠券发放记录管理")
@RestController
@RequestMapping("api")
public class StoreCouponUserController {

    private final OrangeStoreCouponUserService orangeStoreCouponUserService;

    public StoreCouponUserController(OrangeStoreCouponUserService orangeStoreCouponUserService) {
        this.orangeStoreCouponUserService = orangeStoreCouponUserService;
    }

    @Log("查询Y")
    @ApiOperation(value = "查询")
    @GetMapping(value = "/orangeStoreCouponUser")
    @PreAuthorize("hasAnyRole('admin','ORANGESTORECOUPONUSER_ALL','ORANGESTORECOUPONUSER_SELECT')")
    public ResponseEntity getOrangeStoreCouponUsers(OrangeStoreCouponUserQueryCriteria criteria, Pageable pageable){
        return new ResponseEntity(orangeStoreCouponUserService.queryAll(criteria,pageable),HttpStatus.OK);
    }


}
